<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>我的订单</title>
	<link rel="shortcut icon" href="../img/favicon.ico">
	<link rel="stylesheet" href="../css/reset.css" />
	<link rel="stylesheet" href="../css/indent.css" />
	<script src="../them/jquery/jquery-1.7.2.js"></script>
	<script src="../them/jquery/jquery.cookie.js"></script>
	<style>
		
	</style>
</head>
<body>
	<!--头部-->
	<div class="site-topbar">
	    <div class="container">
	        <div class="topbar-nav">
	            <a href="javascript:;">多看阅读</a>
	            <a href="javascript:;">云服务</a>
	            <a href="javascript:;">金融</a>
	            <a href="javascript:;">小米商城移动版</a>
	        </div>
	        <div class="topbar-cart">
	            <a href="shopCart.html" class="cart-mini">
	                <span class="cart"></span>
	                <span>购物车</span>
	                <span class="gwc_number"></span>
	            </a>
	        </div>
	        <div class="topbar-info">
				<div class="login" style="display: inline-block">
					<a href="login.html">登录</a>
					<a href="register.html">注册</a>
				</div>
	            <a href="javascript:;">消息通知</a>
	            <!--<div class="info_select">
	                <a href="personal-center.html">个人中心</a>
	                <a href="user-favorite.html">我的喜欢</a>
	                <a href="login.html">退出登录</a>
	            </div>-->
	        </div>
	    </div>
	</div>
	<!--导航-->
	<div class="site-header">
	    <div class="container">
	        <div class="header-logo">
	            <a href="index.html">
	                <span class="logo"></span>
	            </a>
	        </div>
			<div class="header-nav">
				<ul class="nav-list">
					<li class="nav-item">
						<a href="javacsript:;" class="link">
							<span>艾灸</span>
						</a>
						<div class="header-nav-menu">
							<div class="container">
								<ul class="children-list clearfix">
									<li style="border-left: 0">
										<div class="figure figure-thumb">
											<a href="javascript:;">
												<img src="http://192.168.31.3:18089/z1.jpg" >
												<p class="tittle">景德镇艾灸礼包</p>
												<p class="price">999元</p>
											</a>
										</div>
									</li>
									<li>
										<div class="figure figure-thumb">
											<a href="javascript:;">
												<img src="http://192.168.31.3:18089/z2.jpg" >
												<p class="tittle">独家艾灸</p>
												<p class="price">999元</p>
											</a>
										</div>
									</li>
									<li>
										<div class="figure figure-thumb">
											<a href="javascript:;">
												<img src="http://192.168.31.3:18089/z3.jpg" >
												<p class="tittle">顶级艾灸</p>
												<p class="price">999元</p>
											</a>
										</div>
									</li>
									<li>
										<div class="figure figure-thumb">
											<a href="javascript:;">
												<img src="http://192.168.31.3:18089/z4.jpg" >
												<p class="tittle">多功能艾灸床</p>
												<p class="price">999元</p>
											</a>
										</div>
									</li>
								</ul>
							</div>
						</div>
					</li>
					<li class="nav-item">
						<a href="javacsript:;" class="link">
							<span>设备</span>
						</a>
						<div class="header-nav-menu">
							<div class="container">
								<ul class="children-list clearfix">
									<li style="border-left: 0">
										<div class="figure figure-thumb">
											<a href="javascript:;">
												<img src="http://192.168.31.3:18089/zb1.jpg" >
												<p class="tittle">推拿仪</p>
												<p class="price">999元</p>
											</a>
										</div>
									</li>
									<li>
										<div class="figure figure-thumb">
											<a href="javascript:;">
												<img src="http://192.168.31.3:18089/aj1.jpg" >
												<p class="tittle">艾香</p>
												<p class="price">999元</p>
											</a>
										</div>
									</li>
									<li>
										<div class="figure figure-thumb">
											<a href="javascript:;">
												<img src="http://192.168.31.3:18089/cx1.jpg" >
												<p class="tittle">艾灸盒</p>
												<p class="price">999元</p>
											</a>
										</div>
									</li>

								</ul>
							</div>
						</div>
					</li>
					<li class="nav-item">
						<a href="javacsript:;" class="link">
							<span>艾柱</span>
						</a>
						<div class="header-nav-menu">
							<div class="container">
								<ul class="children-list clearfix">
									<li style="border-left: 0">
										<div class="figure figure-thumb">
											<a href="javascript:;">
												<img src="http://192.168.31.3:18089/LH2.jpg" >
												<p class="tittle">艾柱贴</p>
												<p class="price">899元</p>
											</a>
										</div>
									</li>
								</ul>
							</div>
						</div>
					</li>
					<li class="nav-item">
						<a href="javacsript:;" class="link">
							<span>文化</span>
						</a>
						<div class="header-nav-menu">
							<div class="container">
								<ul class="children-list clearfix">
									<li style="border-left: 0">
										<div class="figure figure-thumb">
											<a href="javascript:;">
												<img src="http://192.168.31.3:18089/LH3.jpg" >
												<p class="tittle">传艾图</p>
												<p class="price">1999元</p>
											</a>
										</div>
									</li>
									<li>
										<div class="figure figure-thumb">
											<a href="javascript:;">
												<img src="http://192.168.31.3:18089/sj1.jpg" >
												<p class="tittle">艾草书</p>
												<p class="price">99元</p>
											</a>
										</div>
									</li>
									<li>
										<div class="figure figure-thumb">
											<a href="javascript:;">
												<img src="http://192.168.31.3:18089/sj4.jpg" >
												<p class="tittle">艾灸百科</p>
												<p class="price">99元</p>
											</a>
										</div>
									</li>

								</ul>
							</div>
						</div>
					</li>
				</ul>
			</div>
			<div class="header-search">
				<div class="search-form clearfix">
					<input class="search-text" type="text">
					<input type="submit" class="search-btn" value=" ">

					<div class="search-hot-words">
						<a href="javasctipy:;">艾灸</a>
						<a href="javascript:;">艾棒</a>
					</div>
					<div class="keyword-list hide">
						<ul class="result-list"></ul>
					</div>
				</div>
			</div>
	    </div>
	</div>
	<div id="conetent_wrapper">
		<div id="content">
			<div class="indent_box">
				<div class="indent_title clearfix">
					<p class="fl">我的订单</p>
					<span class="fl">请谨防钓鱼链接或诈骗电话！</span>
				</div>
				<div class="indent_navbox clearfix">
					<ul class="indent_nav fl">
						<li class="fl active all">全部有效订单</li>
						<li class="fl wzf">未支付</li>
						<li class="fl yfk">已付款</li>
						<li class="fl yfh">已发货</li>
						<li class="fl yqx">已取消</li>
						<li class="fl jycg">交易成功</li>
						<li class="fl jygb">交易关闭</li>
					</ul>
					<div class="indent_search">
						<input type="text" placeholder="输入商品名称、订单号、商品编号" class="indent_search_inp fl">
						<div class="indent_search_img fl" ></div>
					</div>
				</div>
				<div class="main"></div>
				<!--<div class="indent_detailsbox">
					<div class="indent_details">
						<p class="indent_status">等待发货</p>
						<p class="indent_predict">预计五天内发货</p>
						<ul class="indent_recipients clearfix">
							<li class="fl indent_time">2017年05月17日 09:05</li>
							<li class="fl indent_name">李亚培</li>
							<li class="fl indent_number">订单号：121212141511</li>
							<li class="fl indent_pay">在线支付</li>
						</ul>
						<p class="indent_money">
							订单金额
							<span class="indent_money_num">
								8889
							</span>
							元
						</p>
					</div>
					<div class="indent_indent clearfix">
						<div class="order_items fl">
							<ul class="goods_list">
								<li>
									<div class="figure">
										<a href="">
											<img src="img/top.jpg" height="80" width="80" alt="">
										</a>
									</div>
									<p class="goods_name">小米手机</p>
									<p class="goods_pric">95元×1</p>
								</li>
								<li>
									<div class="figure">
										<a href="">
											<img src="img/top.jpg" height="80" width="80" alt="">
										</a>
									</div>
									<p class="goods_name">小米手机</p>
									<p class="goods_pric">95元×1</p>
								</li>
							</ul>
						</div>
						<div class="order_actions">
							<a href="#" class="btn_primary">立即支付</a>
							<a href="#">查看详情</a>
						</div>
					</div>
				</div>-->
				<div style="display:none;" class="content_blank">当前没有~</div>
				<div class="paging_box">
					<!--<span class="left prev"><</span>-->
					<ul class="clearfix">
						<!--<li class="fl current">1</li>
						<li class="fl ">2</li>-->
					</ul>
					<!--<span class="right next">></span>-->
				</div>
				
			</div>
		</div>
	</div>
	<div class="footer">
		<div class="fuwu">
			<ul>
				<li>预约维修服务</li>
				<li>7天无理由退货</li>
				<li>15天免费换货</li>
				<li>满150元包邮</li>
				<li>520余家售后网点</li>
			</ul>
		</div>
		<div class="fuwu_det clearfix">
			<ul class="fl fuwu_det_item">
				<li class="fuwu_det_i fl">
					<p>帮助中心</p>
					<ul>
						<li>账户管理</li>
						<li>购物指南</li>
						<li>订单操作</li>
					</ul>
					
				</li>
				<li class="fuwu_det_i fl">
					<p>帮助中心</p>
					<ul>
						<li>账户管理</li>
						<li>购物指南</li>
						<li>订单操作</li>
					</ul>
				</li>
				<li class="fuwu_det_i fl">
					<p>帮助中心</p>
					<ul>
						<li>账户管理</li>
						<li>购物指南</li>
						<li>订单操作</li>
					</ul>
				</li>
				<li class="fuwu_det_i fl">
					<p>帮助中心</p>
					<ul>
						<li>账户管理</li>
						<li>购物指南</li>
						<li>订单操作</li>
					</ul>
				</li>
				<li class="fuwu_det_i fl">
					<p>帮助中心</p>
					<ul>
						<li>账户管理</li>
						<li>购物指南</li>
						<li>订单操作</li>
					</ul>
				</li>
				<li class="fuwu_det_i fl">
					<p>帮助中心</p>
					<ul>
						<li>账户管理</li>
						<li>购物指南</li>
						<li>订单操作</li>
					</ul>
				</li>
			</ul>
			<ul class="fl fuwu_det_tel">
				<li class="fuwu_det_num">400-100-5678</li>
				<li class="fuwu_det_time">周一至周日 8:00-18:00</li>
				<li class="fuwu_det_time">（仅收市话费）</li>
				<li class="fuwu_det_btn">24小时在线客服</li>
			</ul>
		</div>
		<div class="bottom clearfix">
			<div class="logo_b fl"></div>
			<div class="bottom_text fl">
				<ul>
					<li>艾家商城</li>
					<li>AiJia</li>
					<li>艾聊</li>
					<li>多看书城</li>
					<li>艾生活艾草</li>
					<li>艾疗</li>
					<li>艾家天猫店</li>
					<li>艾家淘宝直营店</li>
					<li>aijia.com</li>
				</ul>
				<p>aijia.com 京ICP证110507号 京ICP备10046444号 京公网安备11010802020134号 京网文[2014]0059-0009号</p>
				<p>违法和不良信息举报电话：185-0130-1238，本网站所列数据，除特殊说明，所有数据均出自我司实验室测试</p>
			</div>
			<div class="bottom_img fl">
				<img src="../../img/truste.png" alt="">
				<img src="../../img/v-logo-1.png" alt="">
				<img src="../../img/v-logo-2.png" alt="">
				<img src="../../img/v-logo-3.png" alt="">
			</div>
		</div>
	</div>
		
	<script>
		/*存搜索字段*/
        $('.search-btn').click(function(){
            var html=$('.search-text').val();
            if(html.length==0){
                return;
            }
            var cookietime = new Date();
            var date = new Date();
            cookietime.setTime(date.getTime() + (24 * 60 * 60 * 1000));
            $.cookie("search", html,{expires:cookietime});
            window.location.href = "search.html";
        });
        $.ajax({
            url: '/cart/get_cart_product_count.do',
            type: 'post',
            success: function (res) {
                console.log(res.data);
                $('.gwc_number').html('('+res.data+')');
                $('.cart-mini').css('background','rgba(255, 103, 0,.7)');
            },
            error: function () {

            }
        });
        $.ajax({
            url:'/user/get_user_info.do',
            type:'post',
            success:function(result){
                var name=result.data.username;
                if(!result.status){
                    $.ajax({
                        url: '/cart/get_cart_product_count.do',
                        type: 'post',
                        success: function (res) {
                            console.log(res.data);
                            $('.gwc_number').html('('+res.data+')');
                            $('.cart-mini').css('background','rgba(255, 103, 0,.7)');
                        }
                    });
                    $('.login').html('<a href="javascript:;">'+name+' , 您好！</a><div class="info_select"> <a href="personal-center.html">个人中心</a> <a href="user-favorite.html">我的喜欢</a> <a href="javascript:;" class="changeInfo">修改信息</a><a href="javascript:;" class="quit">退出登录</a> </div>');
                    $('.quit').click(function(){
                        $.ajax({
                            url:'/user/logout.do',
                            type:'post',
                            success:function(result){
                                if(!result.status){
                                    $('.hint').html('');
                                    window.location.href='index.html';
                                }
                            }
                        });
                    });
                    $('.changeInfo').click(function(){
                        window.location.href='change-information.html';
                    });
                }
            }
        });
		var _width=$(window).width();
		$('.header-nav-menu').css('width',_width);
		$('.header-nav-menu').css('left','-40px');

  		$('.header-nav .nav-list li').mouseover(function(){
	       $(this).find($('.header-nav-menu')).css('display','block');
	    });
	    $('.header-nav .nav-list li').mouseout(function(){
	        $(this).find($('.header-nav-menu')).css('display','none');
	    });
	    
	  	$('.indent_nav li').click(function(){
            $(this).addClass('active').siblings().removeClass('active');
	    });
		allOrders();
		var Allsize;
		$('.all').click(function(){
            $('.main').html('');
            $('.paging_box ul').html('');
          allOrders();


		});
        $('.wzf').click(function(){
            $('.main').html('');
            $('.paging_box ul').html('');
            allOrders(10);


        });
        $('.yfk').click(function(){
            $('.main').html('');
            $('.paging_box ul').html('');
            allOrders(20);


        });
        $('.yfh').click(function(){
            $('.main').html('');
            $('.paging_box ul').html('');
            allOrders(40);

        });
        $('.jygb').click(function(){
            $('.main').html('');
            $('.paging_box ul').html('');
            allOrders(60);

        });
        $('.jycg').click(function(){
            $('.main').html('');
            $('.paging_box ul').html('');
            allOrders(50);

        });
        $('.yqx').click(function(){
            $('.main').html('');
            $('.paging_box ul').html('');
            allOrders(0);

        });

	  	/*获取全部订单*/
        function allOrders(status){
            $.ajax({
                url:'/order/list.do',
                data:{
                    status:status,
                    pageNum:1,
                    pageSize:10
                },
                success:function(str){
                    if(!str.status){
                        var arr;
                        var page=str.data.pages;
                        Allsize=str.data.size;
                        for(var i=0;i<str.data.list.length;i++){
							/*console.log(str.data.list[i]);*/
                            arr=str.data.list[i].orderItemVoList;
                            var total_prices=parseFloat(str.data.list[i].postage)+parseFloat(str.data.list[i].payment);
                            var cont=' <div class="indent_detailsbox"><div class="indent_details"><p class="indent_status">'+str.data.list[i].statusDesc+'</p> <p class="indent_predict"></p> <ul class="indent_recipients clearfix"> <li class="fl indent_time">'+str.data.list[i].createTime+'</li> <li class="fl indent_name">'+str.data.list[i].receiverName+'</li> <li class="fl indent_number">订单号：'+str.data.list[i].orderNo+'</li> <li class="fl indent_pay">'+str.data.list[i].statusDesc+'</li> </ul> <p class="indent_money"> 订单金额 <span class="indent_money_num"> '+total_prices+' 元</span> </p> </div> <div class="indent_indent clearfix">   <div class="order_items fl"> <ul class="goods_list"></ul> </div>   <div class="order_actions"> <a href="payindent.html" class="btn_primary payment" id="'+str.data.list[i].orderNo+'">立即支付</a> <a href="indentDetils.html" class="details" id="'+str.data.list[i].orderNo+'">查看详情</a> </div> </div> </div>';
                            $('.main').append(cont);

                            if($('.indent_status').eq(i).html()=="已取消"){
                                $('.payment').eq(i).css('display','none');
                            }
                            if($('.indent_status').eq(i).html()=="已付款"){
                                $('.payment').eq(i).css('display','none');
                            }
                            for(var j=0;j<arr.length;j++){
                                var cont2='<li> <div class="figure"> <a href=""> <img src="'+str.data.list[i].imageHost+arr[j].productImage+'" height="80" width="80" alt=""> </a> </div> <p class="goods_name">'+arr[j].productName+'</p> <p class="goods_pric">'+arr[j].currentUnitPrice+'元×'+arr[j].quantity+'</p> </li>';
                                $('.goods_list').eq(i).append(cont2);
                            }
                        }
                        details();
						payment();
                        if($('.main').children().length>0){
                            $('.content_blank').css('display','none');
                            $('.paging_box ul').css('display','block');
                        }
                        if($('.main').children().length==0){
                            $('.content_blank').css('display','block');
                        }


                        for(var i=1;i<=page;i++){
                            var content='<li class="fl ">'+i+'</li>';
                            $('.paging_box ul').append(content);
                            $('.paging_box ul li').eq(0).addClass('current');
                        }
                        $('.paging_box ul li').click(function(){
                            $('.main').html('');
                            $(this).addClass('current').siblings().removeClass('current');
                            var _page=parseInt($(this).html());
                            $.ajax({
                                url:'/order/list.do',
                                data:{
                                    pageNum:_page,
                                    pageSize:10
                                },
                                success:function(str){
                                    if(!str.status){
                                        var arr;
                                        var page=str.data.pages;
                                        for(var i=0;i<str.data.list.length;i++){
											/*console.log(str.data.list[i]);*/
                                            arr=str.data.list[i].orderItemVoList;

                                            var cont=' <div class="indent_detailsbox"><div class="indent_details"><p class="indent_status">'+str.data.list[i].statusDesc+'</p> <p class="indent_predict"></p> <ul class="indent_recipients clearfix"> <li class="fl indent_time">'+str.data.list[i].createTime+'</li> <li class="fl indent_name">李亚培</li> <li class="fl indent_number">订单号：'+str.data.list[i].orderNo+'</li> <li class="fl indent_pay">'+str.data.list[i].statusDesc+'</li> </ul> <p class="indent_money"> 订单金额 <span class="indent_money_num"> '+str.data.list[i]. payment+' 元</span> </p> </div> <div class="indent_indent clearfix">   <div class="order_items fl"> <ul class="goods_list">   </ul> </div>   <div class="order_actions"> <a href="payindent.html" class="btn_primary payment" id="'+str.data.list[i].orderNo+'">立即支付</a> <a class="details" id="'+str.data.list[i].orderNo+'" href="indentDetils.html">查看详情</a> </div> </div> </div>';
                                            $('.main').append(cont);
                                            if($('.indent_status').eq(i).html()=="已取消"){
                                                $('.payment').eq(i).css('display','none');
                                            }
                                            if($('.indent_status').eq(i).html()=="已付款"){
                                                $('.payment').eq(i).css('display','none');
                                            }
                                            for(var j=0;j<arr.length;j++){
                                                var cont2='<li> <div class="figure"> <a href=""> <img src="'+str.data.list[i].imageHost+arr[j].productImage+'" height="80" width="80" alt=""> </a> </div> <p class="goods_name">'+arr[j].productName+'</p> <p class="goods_pric">'+arr[j].currentUnitPrice+'元×'+arr[j].quantity+'</p> </li>';
                                                $('.goods_list').eq(i).append(cont2);
                                            }
                                        }
                                       /* if($('.indent_status').html()=="已取消"){
                                            $('.payment').css('display','none');
                                        }*/
                                        details();
                                        payment();
                                        if($('.main').children().length>0){
                                            $('.content_blank').css('display','none');
                                            $('.paging_box ul').css('display','block');
                                        }
                                        if($('.main').children().length==0){
                                            $('.content_blank').css('display','block');
                                        }
                                    }
                                }
                            });
                        });
                    }
                }
            });
		};

        /**/
        function details(){
            $('.details').click(function(){
                var cookietime = new Date();
                var date = new Date();
                cookietime.setTime(date.getTime() + (24 * 60 * 60 * 1000));
                $.cookie('orderNo', $(this).attr('id') , { path: '/', expires: cookietime});
            });
		}
		function payment(){
            $('.payment').click(function(){
                var cookietime = new Date();
                var date = new Date();
                cookietime.setTime(date.getTime() + (24 * 60 * 60 * 1000));
                $.cookie('payment', $(this).attr('id') , { path: '/', expires: cookietime});
            });
		}
	</script>
	
</body>
</html>